//app.js
import {promisifyAll} from "miniprogram-api-promise"

const wxp = wx.p = {}

promisifyAll(wx, wxp)

App({
  onLaunch: function () {
    // 展示本地存储能力
    var logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    wx.login({
      success: res => {
        this.globalData.code = res.code
      }
  })
  },
  globalData: {
    appID : 'wx756da077838504a4',
    appSecret : 'afae3d3fb2f63d0d58430ca49e2961f0',
    encryptedData : '',
    iv : '',
    code : '',
    sessionkey: '',
    openid: '',
    api: 'http://112.124.41.199:6112/csms/'
  }
})